C++ = g++
CCFLAGS = -Wall -I../src -finline-functions -g -O0
LDFLAGS = -L../src -lstdc++ -ludt -lpthread -lm -Wl,-Ttext-segment=0x600000

DIR = $(shell pwd)

APP = apptest appserver appclient sendfile recvfile test

all: $(APP)

%.o: %.cpp
	$(C++) $(CCFLAGS) $< -c

apptest: apptest.o
	$(C++) $^ -o $@ $(LDFLAGS)
appserver: appserver.o
	$(C++) $^ -o $@ $(LDFLAGS)
appclient: appclient.o
	$(C++) $^ -o $@ $(LDFLAGS)
sendfile: sendfile.o
	$(C++) $^ -o $@ $(LDFLAGS)
recvfile: recvfile.o
	$(C++) $^ -o $@ $(LDFLAGS)
test: test.o
	$(C++) $^ -o $@ $(LDFLAGS)

clean:
	rm -f *.o $(APP)

install:
	export PATH=$(DIR):$$PATH
